home *** CD-ROM | disk | FTP | other *** search
/ Animation How-To / Animation How-to CD.iso / PLY / CHAPTER2 / DRIP / 5DRIP2.PI < prev    next >
Text File  |  1994-01-01  |  3KB  |  153 lines

  1. //
  2. // 5DRIP1.PI  5D Dripping Faucet Animation
  3. //            (formerly 4D or 3DRIP... inflation<g>)
  4. // Polyray input file - Jeff Bowermaster
  5. // 
  6. // This version rotates the viewpoint. 
  7.  
  8. // Define the range of the animation
  9. start_frame 0
  10. end_frame   89
  11. total_frames 90
  12. define shift frame/30
  13.  
  14. outfile drip1
  15.  
  16. // Set up the camera
  17. viewpoint {
  18.    from rotate(<8,8,-8>,<0,frame,0>)
  19.    at <0,0,0>
  20.    up <0,1,0>
  21.    angle 45
  22.    resolution 320,200
  23.    aspect 1.43
  24.    }
  25.  
  26. // Set up background color & lights
  27. background skyblue
  28. spot_light white,< 0,50,0>,<0,0,0>, 3, 15, 30
  29.  
  30. include "\ply\colors.inc"
  31.  
  32. define blue_glass
  33. texture {
  34.    surface {                        // when experimenting, save old values
  35.       ambient yellow, 0.1           // 0.2
  36.       diffuse midnightblue, 0.2     // 0.6
  37.       specular 0.9                  // 0.6
  38.       reflection white, 0.05        // 0.1
  39.       microfacet Phong 2
  40.       transmission white, 0.98, 1.5 // 0.95
  41.       }
  42.    }
  43.  
  44. // Give the initial locations of the blob points
  45.  
  46. define p11   < 1, 0, 0 >
  47. define p12   < 0, 1, 0 >
  48. define p13   < 0, 0, 1 >
  49. define p14   <-1, 0, 0 >
  50. define p15   < 0,-1, 0 >
  51. define p16   < 0, 0,-1 >
  52.  
  53. define p21   < 2, 0, 0 >
  54. define p22   < 0, 2, 0 >
  55. define p23   < 0, 0, 2 >
  56. define p24   <-2, 0, 0 >
  57. define p25   < 0,-2, 0 >
  58. define p26   < 0, 0,-2 >
  59.  
  60. define p31   < 3, 0, 0 >
  61. define p32   < 0, 3, 0 >
  62. define p33   < 0, 0, 3 >
  63. define p34   <-3, 0, 0 >
  64. define p35   < 0,-3, 0 >
  65. define p36   < 0, 0,-3 >
  66.  
  67.  
  68. define annoying_marble1
  69. texture {
  70.    noise surface {
  71.       color white
  72.       position_fn 1
  73.       lookup_fn 1
  74.       octaves 3
  75.       turbulence 3
  76.       ambient 0.3
  77.       diffuse 0.8
  78.       specular 0.3
  79.       microfacet Reitz 5
  80.       color_map(
  81.          [0.0, 0.8, Yellow, Yellow*0.6]
  82.          [0.8, 1.0, Yellow*0.6,Navyblue])
  83.       }
  84.    translate <shift,0,-shift>
  85.    }
  86.  
  87. define annoying_marble2
  88. texture {
  89.    noise surface {
  90.       color white
  91.       position_fn 1
  92.       lookup_fn 1
  93.       octaves 3
  94.       turbulence 3
  95.       ambient 0.3
  96.       diffuse 0.8
  97.       specular 0.3
  98.       microfacet Reitz 5
  99.       color_map(
  100.          [0.0, 0.8, Navyblue, Navyblue*0.6]
  101.          [0.8, 1.0, Navyblue*0.6,Yellow])
  102.       }
  103.    translate <shift,0,-shift>
  104.    }
  105.  
  106. // Create a floor
  107. define ground
  108. object {
  109.    polynomial y + 0.01
  110.    texture { checker annoying_marble1, annoying_marble2}
  111.    scale <6, 6, 6>
  112.    translate <0,-10,0>
  113.    }
  114.  
  115. // A blob explodes along the xyz axes
  116.  
  117. define framer frame/25
  118.  
  119. define dripper
  120. object {
  121.    blob 0.10:
  122.       0.1, 3.0, p11*framer,
  123.       0.1, 3.0, p12*framer,
  124.       0.1, 3.0, p13*framer,
  125.       0.1, 3.0, p14*framer,
  126.       0.1, 3.0, p15*framer,
  127.       0.1, 3.0, p16*framer,
  128.       0.1, 3.0, p21*framer,
  129.       0.1, 3.0, p22*framer,
  130.       0.1, 3.0, p23*framer,
  131.       0.1, 3.0, p24*framer,
  132.       0.1, 3.0, p25*framer,
  133.       0.1, 3.0, p26*framer,
  134.       0.1, 3.0, p31*framer,
  135.       0.1, 3.0, p32*framer,
  136.       0.1, 3.0, p33*framer,
  137.       0.1, 3.0, p34*framer,
  138.       0.1, 3.0, p35*framer,
  139.       0.1, 3.0, p36*framer,
  140.       0.5, 3.0, <0,0,0>
  141.    root_solver Ferrari
  142.    u_steps 20
  143.    v_steps 20
  144.    blue_glass
  145.    }
  146.  
  147. dripper
  148.  
  149. define shift frame/30
  150. ground { translate <-2*shift,0,2*shift> }
  151.  
  152.  
  153.